/****************************************************************************
*
* Copyright (c) 2023  C*Core -   All Rights Reserved
*
* THIS SOFTWARE IS DISTRIBUTED "AS IS, " AND ALL WARRANTIES ARE DISCLAIMED,
* INCLUDING MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* PROJECT     : CCFC2011BC
* DESCRIPTION : IVOR branch table interrupts.
* HISTORY     : Initial version.
* @file     ivor_branch_table.c
* @version  1.1
* @date     2023 - 02 - 20
* @brief    Initial version.
*
*****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif

#pragma push
#define SIXTEEN_BYTES 16


extern void EXCEP_DefaultExceptionHandler1(void);
extern void EXCEP_DefaultExceptionHandler2(void);
extern void EXCEP_DefaultExceptionHandler6(void);


/* IVOR4 will call this handler */
extern void INTC_INTCInterruptHandler(void);

/* Set interrupt handlers */
#pragma section code_type ".ivor_branch_table"
#pragma force_active on
#pragma function_align 16
#pragma require_prototypes off

asm void ivor_branch_table(void)/* PRQA S 1006, 3408 */
{
  nofralloc
				.align SIXTEEN_BYTES       
IVOR0trap:  b	IVOR0trap	 // IVOR 0 interrupt handler

				.align SIXTEEN_BYTES       
IVOR1trap:  b	IVOR1trap	 // IVOR 1 interrupt handler
						
				.align SIXTEEN_BYTES       
IVOR2trap:  b	EXCEP_DefaultExceptionHandler2	 // IVOR 2 interrupt handler

				.align SIXTEEN_BYTES       
IVOR3trap:  b	IVOR3trap	 // IVOR 3 interrupt handler

				.align SIXTEEN_BYTES       
IVOR4trap:  b   INTC_INTCInterruptHandler // External Interrupt

				.align SIXTEEN_BYTES       
IVOR5trap:  b	IVOR5trap    // IVOR 5 interrupt handler

				.align SIXTEEN_BYTES       
IVOR6trap:  b	EXCEP_DefaultExceptionHandler6	 // IVOR 6 interrupt handler

				.align SIXTEEN_BYTES       
IVOR7trap:  b	IVOR7trap	 // IVOR 7 interrupt handler

				.align SIXTEEN_BYTES       
IVOR8trap:  b	IVOR8trap	 // IVOR 8 interrupt handler

				.align SIXTEEN_BYTES       
IVOR9trap:  b	IVOR9trap	 // IVOR 9 interrupt handler

				.align SIXTEEN_BYTES       
IVOR10trap: b   IVOR10trap   // IVOR 10 interrupt handler

				.align SIXTEEN_BYTES       
IVOR11trap:  b	IVOR11trap	 // IVOR 11 interrupt handler

				.align SIXTEEN_BYTES       
IVOR12trap:  b	IVOR12trap	 // IVOR 12 interrupt handler

				.align SIXTEEN_BYTES       
IVOR13trap:  b	IVOR13trap	 // IVOR 13 interrupt handler

				.align SIXTEEN_BYTES       
IVOR14trap:  b	IVOR14trap	 // IVOR 14 interrupt handler

				.align SIXTEEN_BYTES       
IVOR15trap:  b	IVOR15trap	 // IVOR15 interrupt handler

        nop  // fill to 0x100 bytes
        nop
        nop
}

#pragma pop

#ifdef __cplusplus
}
#endif
